let go_h5pay = (data=[])=>{
	uni.navigateTo({
		url: '/pages/tabBar/h5'
	})
	setTimeout(() => {
		uni.$emit('go_h5',{url:data})
	},600)
}
let go_mpwxpay = (data=[])=>{
	return new Promise((resolve, reject) => {
		uni.requestPayment({
			provider: 'wxpay',
			orderInfo: data,
			appId: data.appId,
			timeStamp: data.timeStamp,
			nonceStr: data.nonceStr,
			package: data.package,
			signType: data.signType,
			paySign: data.paySign,
			success: (res) => {
				resolve(res)
			},
			fail: (err) => {
				this.$tip.tip("支付失败")
				reject(err)
			}
		});
	})
}
let go_appwxpay = (data=[])=>{
	return new Promise((resolve, reject) => {
		uni.requestPayment({
			provider: 'wxpay',
			orderInfo: data,
			success: (res) => {
				resolve(res)
			},
			fail: (err) => {
				this.$tip.tip("支付失败")
				reject(err)
			}
		});
	})
}
let go_appalipay = (data=[])=>{
	return new Promise((resolve, reject) => {
		uni.requestPayment({
			provider: 'alipay',
			orderInfo: data,
			success: (res) => {
				resolve(res)
			},
			fail: (err) => {
				reject(err)
			}
		});
	})
}

module.exports = {
	go_h5pay,
	go_mpwxpay,
	go_appwxpay,
	go_appalipay,
}